#ifndef __CARTRIDGEBOARD_H
#define __CARTRIDGEBOARD_H
#include<Windows.h>
#include"typedef.h"

typedef struct
{
	uint8_t MagicNumber[4];
	uint8_t PrgSize;
	uint8_t ChrSize;
	uint8_t Flag6;
	uint8_t Flag7;
	uint8_t Reserved[8];
}iNESHeader;

typedef struct __CARTRIDGEBOARD
{
	bool (*LoadRom)(struct __CARTRIDGEBOARD* cart, PCTSTR szFilePath);

	iNESHeader Header;
	uint8_t* Trainer;
	uint8_t* ChrRom;
	uint8_t* PrgRom;

}CARTRIDGEBOARD;

void CartridgeBoardInit(CARTRIDGEBOARD*);
void CartridgeBoardFree(CARTRIDGEBOARD*);

enum
{
	MAPPER_MASK_LOW = 0xf0,
	FOUR_SCREEN = 0x08,
	TRAINER = 0x04,
	SRAM = 0x02,
	MIRROR_VERTICAL = 0x01
};
enum
{
	MAPPER_MASK_HIGH = 0xf0,
};
#endif /*__CARTRIDGEBOARD_H*/

